package edu.ubb.scp.model;

import java.lang.reflect.Field;

public class ProductType implements Model {
	private int ProductTypeID;
	private String ProductTypeName;

	public ProductType(String productTypeName) {
		super();
		ProductTypeName = productTypeName;
	}

	public ProductType() {

	}

	public int getProductTypeID() {
		return ProductTypeID;
	}

	public void setProductTypeID(int productTypeID) {
		ProductTypeID = productTypeID;
	}

	public String getProductTypeName() {
		return ProductTypeName;
	}

	public void setProductTypeName(String productTypeName) {
		ProductTypeName = productTypeName;
	}

	@Override
	public String toString() {
		return "ProductType [ProductTypeID=" + ProductTypeID
				+ ", ProductTypeName=" + ProductTypeName + "]";
	}
	
	@Override
	public Field getPrimaryKey() {
		try {
			return ProductType.class.getDeclaredField("ProductTypeID");
		} catch (NoSuchFieldException e) {
			e.printStackTrace();
		} catch (SecurityException e) {
			e.printStackTrace();
		}
		return null;
	}
	
	@Override
	public Field[] getKeys() {
		return new Field[] { getPrimaryKey() };
	}

}
